<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Document</title>
  </head>
  <body>
    <div id="app"></div>

    <template id="t">
      <div @click="fn2">
        父元素
        <button @click.stop="fn1">btn</button>
      </div>
    </template>

    <script src="./vue.js"></script>
    <script>
      Vue.createApp({
        template: '#t',
        methods: {
          fn1: () => {
            console.log('子元素')
          },
          fn2() {
            console.log('父元素')
          }
        }
      }).mount('#app')
    </script>
  </body>
</html>
